﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Admin_Product.aspx.cs"
    Inherits="V5_EShop.Admin.Admin_Product" MasterPageFile="~/Admin/admin.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Header" runat="server">
    <script type="text/javascript">
        function editProductCode(obj) {
            if (!obj.checked) {
                $("#txtProductCode").attr("disabled", true);
            } else {
                $("#txtProductCode").attr("disabled", false);
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Title" runat="server">
    产品管理
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Nav" runat="server">
    <a href="Admin_Product.aspx?ClassID=<%=ClassID%>">产品管理</a> | <a href="Admin_Product.aspx?Action=edit&ClassID=<%=ClassID%>">添加产品</a>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Content" runat="server">
    <asp:MultiView ID="MultiViewList" runat="server">
        <asp:View ID="View1" runat="server">
            <asp:GridView ID="gvList" runat="server" AutoGenerateColumns="False" GridLines="None"
                CssClass="tablelist tableheader overlist" OnRowCommand="gvList_RowCommand">
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:CheckBox ID="chkitem" runat="server" />
                        </ItemTemplate>
                        <ItemStyle Width="30px" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="ID" HeaderText="ID">
                        <ItemStyle Width="30px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="ProductName" HeaderText="管理名称" />
                    <asp:TemplateField HeaderText="市场价格">
                        <ItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ProductMarketPrice")%>'
                                Width="80px"></asp:TextBox>
                        </ItemTemplate>
                        <ItemStyle Width="100px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="会员价格">
                        <ItemTemplate>
                            <asp:TextBox ID="TextBox2" runat="server" Width="80px" Text='<%# Bind("ProductMemberPrice")%>'></asp:TextBox>
                        </ItemTemplate>
                        <ItemStyle Width="100px" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="ProductCount" HeaderText="库存量">
                        <ItemStyle Width="60px" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="缩图">
                        <ItemTemplate>
                            <img alt="" src="images/icon-viewpic.gif" onmouseover="outpic('../<%# DataBinder.Eval(Container.DataItem,"ProductBigPic")%>')"
                                onmouseout="nd();" />
                        </ItemTemplate>
                        <ItemStyle Width="50px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="状态">
                        <ItemTemplate>
                            <%#DataBinder.Eval(Container.DataItem,"IsPassed").ToString()=="1"?"√":"×"%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="管理属性">
                        <ItemTemplate>
                            &nbsp;<%# DataBinder.Eval(Container.DataItem, "IsRecommond").ToString() == "1" ? "推荐" : ""%>
                            <%# DataBinder.Eval(Container.DataItem, "IsNew").ToString() == "1" ? "新品" : ""%>
                            <%# DataBinder.Eval(Container.DataItem, "IsOnHot").ToString() == "1" ? "热点" : ""%>
                            <%# DataBinder.Eval(Container.DataItem, "IsSpecialOffer").ToString() == "1" ? "特价" : ""%>
                        </ItemTemplate>
                        <ItemStyle Width="180px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="操作">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%#Eval("ID")%>'
                                CommandName="go">修改</asp:LinkButton>
                            <asp:LinkButton ID="LinkButton2" runat="server" CommandArgument='<%#Eval("ID")%>'
                                CommandName="del">删除</asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle Width="150px" />
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <br />
            <table width="96%" border="0" align="center" cellpadding="0" cellspacing="0" class="tablelist tableheader">
                <tr>
                    <td colspan="7">搜索：
                        <asp:TextBox ID="txtSearchText" runat="server"></asp:TextBox>
                        <asp:Button ID="btnSearch" runat="server" CausesValidation="False" Text="搜 索" OnClick="btnSearch_Click" />
                    </td>
                </tr>
                <tr>
                    <td colspan="7" align="right">
                        <input name="chkall" type="checkbox" id="chkall" onclick="javascript: SelectAll(this);"
                            value="checkbox" />
                        全选/取消
                        <asp:DropDownList ID="ddlAll" runat="server">
                            <asp:ListItem Value="0">请选择一个操作</asp:ListItem>
                            <asp:ListItem Value="1">批量删除</asp:ListItem>
                        </asp:DropDownList>
                        <asp:Button ID="btnAll" runat="server" Text="执行操作" EnableViewState="False" OnClick="btnAll_Click" />
                    </td>
                </tr>
                <tr>
                    <td colspan="7" align="right">
                        <webdiyer:AspNetPager ID="Pager" runat="server" CustomInfoHTML="共%PageCount%页，当前为第%CurrentPageIndex%页，每页%PageSize%条"
                            FirstPageText="首页" HorizontalAlign="Right" LastPageText="尾页" NextPageText="下一页"
                            OnPageChanged="Pager_PageChanged" PageIndexBoxType="DropDownList" PageSize="20"
                            PrevPageText="上一页" ShowCustomInfoSection="Left" ShowPageIndexBox="Always" SubmitButtonText="Go"
                            TextAfterPageIndexBox="页" TextBeforePageIndexBox="转到" AlwaysShow="True">
                        </webdiyer:AspNetPager>
                    </td>
                </tr>
            </table>
            <div id="overDiv" style="z-index: 1000; visibility: hidden; position: absolute">
            </div>
        </asp:View>
        <asp:View ID="View2" runat="server">
            <table align="center" border="0" cellpadding="5" cellspacing="1" class="tablelist tableheader">
                <tr>
                    <td colspan="2">&nbsp;
                        <asp:Label ID="lblTitle" runat="server" Text="添加产品"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td width="15%">产品名称：
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductName" runat="server" Width="355px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>所属分类：
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlClassID" runat="server">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>产品关键字：
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductKeysWords" runat="server" Width="355px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>产品代码：
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductCode" runat="server" Width="269px" Enabled="false"></asp:TextBox>
                        <input id="Checkbox1" type="checkbox" onclick="editProductCode(this)" />修改
                    </td>
                </tr>
                <tr>
                    <td>产品品牌：
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductBrand" runat="server" Width="251px"></asp:TextBox>
                        <asp:DropDownList ID="ddlProductBrand" runat="server" onchange="txtProductBrand.value=this.value;">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>产品单位：
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductUnit" runat="server" Width="29px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>产品重量：
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductWeight" runat="server" Width="29px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>产品市场价格：
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductMarketPrice" runat="server" Width="55px">0</asp:TextBox>
                        ：元 会员价格
                        <asp:TextBox ID="txtProductMemberPrice" runat="server" Width="49px">0</asp:TextBox>
                        ：元
                    </td>
                </tr>
                <tr>
                    <td>最低购买价格：
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductMinPrice" runat="server" Width="55px">0</asp:TextBox>
                        ：元
                    </td>
                </tr>
                <tr>
                    <td>产品大图：
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductBigPic" runat="server" Width="262px"></asp:TextBox>
                        &nbsp;
                        <%--<input id="Button1" type="button" value="选择图片" onclick="OpenPictureDialog('txtProductBigPic',620,450);" />--%><input
                            id="Button2" type="button" value="选择图片" onclick="OpenPictureDialog1('txtProductBigPic', 900, 550);" />
                        请选择productm目录下的图片
                    </td>
                </tr>
                <tr>
                    <td>产品多图：
                    </td>
                    <td>
                        <asp:GridView ID="dlProductMorePicList" runat="server" AutoGenerateColumns="False"
                            GridLines="None" OnRowCommand="dlProductMorePicList_RowCommand">
                            <Columns>
                                <asp:TemplateField HeaderText="说明">
                                    <ItemTemplate>
                                        <asp:Label ID="lblmorepictitle" runat="server" Text='<%#Bind("more1")%>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle Width="100px" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="图片地址">
                                    <ItemTemplate>
                                        <img alt="" src="images/icon-viewpic.gif" onmouseover="outpic('../<%# DataBinder.Eval(Container.DataItem,"more2")%>')"
                                            onmouseout="nd();" id="imgpicurl" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="操作">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"ID")%>'
                                            CommandName="picgo" CausesValidation="False">修改</asp:LinkButton>
                                        <asp:LinkButton ID="LinkButton2" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"ID")%>'
                                            CommandName="picdel" CausesValidation="False">删除</asp:LinkButton>
                                    </ItemTemplate>
                                    <ItemStyle Width="100px" />
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                        <asp:HiddenField ID="hfsID" runat="server" />
                        说明:
                        <asp:TextBox ID="txtProductMorePicReadme" runat="server" Width="78px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtProductMorePicReadme"
                            ErrorMessage="*"></asp:RequiredFieldValidator>
                        地 址:<asp:TextBox ID="txtProductMorePicSelect" runat="server" Width="219px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtProductMorePicSelect"
                            ErrorMessage="*"></asp:RequiredFieldValidator>
                        &nbsp;
                        <asp:Button ID="txtProductMorePicSave" runat="server" Text="添加" OnClick="txtProductMorePicSave_Click" />
                        &nbsp;&nbsp;&nbsp;
                        <input id="Button5" onclick="OpenPictureDialog1('txtProductMorePicSelect', 900, 550);"
                            type="button" value="选择图片" />
                        请选择productm目录下的图片
                    </td>
                </tr>
                <tr>
                    <td>产品数量：
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductCount" runat="server" Width="37px">10</asp:TextBox>
                        ：个
                    </td>
                </tr>
                <tr>
                    <td>产品属性：
                    </td>
                    <td>
                        <asp:Repeater ID="rpFieldList2" runat="server">
                            <ItemTemplate>
                                <li>
                                    <asp:Label ID="lblTitle" runat="server" Text='<%#Eval("FieldName")%>'></asp:Label>:<asp:TextBox
                                        ID="txtFieldName" runat="server" Text='<%#Eval("FieldValues")%>'></asp:TextBox></li>
                            </ItemTemplate>
                        </asp:Repeater>
                    </td>
                </tr>
                <tr>
                    <td>产品扩展属性：
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlSelectType" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlSelectType_SelectedIndexChanged">
                        </asp:DropDownList>
                        <asp:Repeater ID="rpFieldList" runat="server" OnItemDataBound="rpFieldList_ItemDataBound">
                            <ItemTemplate>
                                <table style="width: 100%;">
                                    <tr>
                                        <td style="width: 10%;">
                                            <asp:Label ID="lblFieldName" runat="server" ForeColor="#0066FF" Text='<%#Eval("FieldName")}'
                                                Width="40px"></asp:Label>
                                            <asp:HiddenField ID="hfFieldID" runat="server" Value='<%#Eval("ID")%>' />
                                        </td>
                                        <td>
                                            <asp:Repeater ID="rpFieldList2" runat="server">
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chksingle" runat="server" Checked="false" Text='<%#Eval("singlefield")%>' />
                                                </ItemTemplate>
                                            </asp:Repeater>
                                            <asp:TextBox ID="txtFieldValue" runat="server" Text='<%#Eval("FieldValues")%>'></asp:TextBox>
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </asp:Repeater>
                    </td>
                </tr>
                <tr>
                    <td>
                        <span class="miaoshu02">产品尺码表：</span>
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductSizeTable" runat="server" TextMode="MultiLine" Height="400px"></asp:TextBox>
                       <script>
                                var editor = new wangEditor('<%=this.txtProductSizeTable.ClientID%>');
                                // 普通的自定义菜单
                                editor.config.menus = [
                                    'bold',
                                    'underline',
                                    'italic',
                                    'strikethrough',
                                    'eraser',
                                    'forecolor',
                                    'bgcolor',
                                    '|',
                                    'quote',
                                    'fontfamily',
                                    'fontsize',
                                    'head',
                                    'unorderlist',
                                    'orderlist',
                                    'alignleft',
                                    'aligncenter',
                                    'alignright',
                                    '|',
                                    'link',
                                    'unlink',
                                    'table',
                                    'emotion',
                                    'insertcode',
                                    '|',
                                    'undo',
                                    'redo',
                                    'fullscreen'
                                ];
                                editor.config.codeDefaultLang = 'C#'
                                editor.create();
                            </script>
                    </td>
                </tr>
                <tr>
                    <td>详细描述：
                    </td>
                    <td>
                      <asp:TextBox ID="txtContent" runat="server" TextMode="MultiLine" Height="400px"></asp:TextBox>
                       <script>
                                var editor = new wangEditor('<%=this.txtContent.ClientID%>');
                                // 普通的自定义菜单
                                editor.config.menus = [
                                    'bold',
                                    'underline',
                                    'italic',
                                    'strikethrough',
                                    'eraser',
                                    'forecolor',
                                    'bgcolor',
                                    '|',
                                    'quote',
                                    'fontfamily',
                                    'fontsize',
                                    'head',
                                    'unorderlist',
                                    'orderlist',
                                    'alignleft',
                                    'aligncenter',
                                    'alignright',
                                    '|',
                                    'link',
                                    'unlink',
                                    'table',
                                    'emotion',
                                    'insertcode',
                                    '|',
                                    'undo',
                                    'redo',
                                    'fullscreen'
                                ];
                                editor.config.codeDefaultLang = 'C#'
                                editor.create();
                            </script>
                    </td>
                </tr>
                <tr>
                    <td style="height: 24px">洗剂说明:
                    </td>
                    <td style="height: 24px">
                        <asp:CheckBoxList ID="chkboxListXiJi" runat="server" RepeatDirection="Horizontal">
                            <asp:ListItem Value="1">40度温水洗剂</asp:ListItem>
                            <asp:ListItem Value="2">分色洗剂</asp:ListItem>
                            <asp:ListItem Value="3">不可漂洗</asp:ListItem>
                            <asp:ListItem Value="4">低温熨烫 最高100度</asp:ListItem>
                            <asp:ListItem Value="5">常温干洗</asp:ListItem>
                            <asp:ListItem Value="6">转龙翻转干燥</asp:ListItem>
                        </asp:CheckBoxList>
                    </td>
                </tr>
                <tr>
                    <td style="height: 24px">产品属性：
                    </td>
                    <td style="height: 24px">
                        <asp:CheckBox ID="cbIsOnSale" runat="server" Checked="true" CssClass="checkboxaspx"
                            Text="上架" />
                        <asp:CheckBox ID="cbIsRecommond" runat="server" CssClass="checkboxaspx" Text="推荐" />
                        <asp:CheckBox ID="cbIsNew" runat="server" CssClass="checkboxaspx" Text="新品" />
                        <asp:CheckBox ID="cbIsHot" runat="server" CssClass="checkboxaspx" Text="热点" />
                        <asp:CheckBox ID="cbIsSpecialOffer" runat="server" CssClass="checkboxaspx" Text="特价" />
                        <asp:CheckBox ID="cbPackage" runat="server" CssClass="checkboxaspx" Text="打包" />
                        &nbsp;
                        <asp:CheckBox ID="chkIsPassed" runat="server" Checked="True" Text="立即发布" />
                    </td>
                </tr>
                <tr>
                    <td>点击次数：
                    </td>
                    <td>
                        <asp:TextBox ID="txtHits" runat="server" Width="29px">0</asp:TextBox>
                        ：次
                    </td>
                </tr>
                <tr>
                    <td>相关产品：
                    </td>
                    <td>
                        <asp:TextBox ID="txtProductRelated" runat="server" Width="250px"></asp:TextBox>
                        <asp:Button ID="btnSearchProduct" runat="server" CausesValidation="False" OnClick="btnSearchProduct_Click"
                            Text="搜索相关管理" />
                    </td>
                </tr>
                <tr>
                    <td>&nbsp;
                    </td>
                    <td>
                        <asp:GridView ID="gvAboutProduct" runat="server" AutoGenerateColumns="False" Width="40%">
                            <Columns>
                                <asp:TemplateField HeaderText="选择">
                                    <ItemTemplate>
                                        <asp:CheckBox ID="chkitem1" runat="server" />
                                    </ItemTemplate>
                                    <HeaderTemplate>
                                        选择
                                    </HeaderTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="ID" HeaderText="ID" />
                                <asp:BoundField DataField="ProductName" HeaderText="产品名称" />
                                <asp:BoundField DataField="ProductCode" HeaderText="产品代码" />
                            </Columns>
                        </asp:GridView>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center">
                        <asp:HiddenField ID="txtChannelID" runat="server" Value="0" />
                        <asp:HiddenField ID="hfID" runat="server" Value="0" />
                        &nbsp;
                        <asp:Button ID="btnSave" runat="server" Text="添加保存" OnClick="btnSave_Click" CausesValidation="False" />
                    </td>
                </tr>
            </table>
        </asp:View>
    </asp:MultiView>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="Footer" runat="server">
</asp:Content>
